//
//  MyAssetsHeadView.m
//  PPDL
//
//  Created by 王洋 on 2019/9/2.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "MyAssetsHeadView.h"


@interface MyAssetsHeadView ()

@property (weak, nonatomic) IBOutlet UILabel *totalMoneyLab;

@property (weak, nonatomic) IBOutlet UILabel *freezeMoneyLab;

@property (weak, nonatomic) IBOutlet UILabel *withDrawMoneyLab;

@property (weak, nonatomic) IBOutlet UIButton *preAuthBtn;

@end

@implementation MyAssetsHeadView

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)fillHeaderWithModel:(MyAssetsHeaderModel *)model {
    
    if (model.isPreAuth) {
        
        [self.preAuthBtn setTitle:@" 取消预授权" forState:UIControlStateNormal];
    } else {
        
        [self.preAuthBtn setTitle:@" 获取参拍资格" forState:UIControlStateNormal];
    }
    
    self.totalMoneyLab.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.itemTotalMoney]];

    self.freezeMoneyLab.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.itemFreezeMoney]];

    self.withDrawMoneyLab.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.itemWithDrawMoney]];
}

- (IBAction)withDrawClick:(id)sender {
    
    if (self.goWithDraw) {
        self.goWithDraw();
    }
}

- (IBAction)canPaiZiGeClick:(id)sender {
    
    if (self.goRecharge) {
        self.goRecharge();
    }
}

- (IBAction)keQuYuETiShi:(id)sender {
    if (self.kequyueAlert) {
        self.kequyueAlert();
    }
}

- (IBAction)dongJieJinETiShi:(id)sender {
    if (self.dongjiejineAlert) {
        self.dongjiejineAlert();
    }
}
@end
